package CONTROLLERS;

import java.sql.Connection;
import java.sql.ResultSet;

import MODELS.BaoHiemModels;
import MODELS.BenhNhanModels;
import MODELS.DichVuModels;
import MODELS.DonThuocModels;
import MODELS.HoSoBAModels;
import MODELS.HoaDonModels;
import MODELS.KhoaModels;
import MODELS.LuongModels;
import MODELS.NhanVienModels;
import MODELS.PhongKhamModels;
import MODELS.ThuocModels;
import MODELS.UserModels;
import ModelEntityFW.DichVuEntitys;
import ModelEntityFW.HoaDonEntitys;
import ModelEntityFW.UserEntitys;

public abstract class BaseControllers<T> {
    protected Connection m_objConnection = null;
    protected UserEntitys m_objSecurityContext = null;
    protected UserModels m_objUserModels = null;
    protected DichVuModels m_objDichVuModels = null;
    protected HoaDonModels m_objHoaDonModels = null;
    protected BaoHiemModels m_objBaoHiemModels = null;
    protected KhoaModels m_objKhoaModels = null;
    protected PhongKhamModels m_objPhongKhamModels = null;
    protected BenhNhanModels m_objBenhNhanModels = null;
    protected DonThuocModels m_objDonThuocModels = null;
    protected HoSoBAModels m_objHoSoBAModels = null;
    protected LuongModels m_LuongModels = null;
    protected NhanVienModels m_NhanVienModels = null;
    protected ThuocModels m_objThuocModels = null;
    
    
    public BaseControllers(Connection objConnection, UserEntitys objSecurity) {
        m_objConnection = objConnection;
        m_objSecurityContext = objSecurity;
        m_objUserModels = new UserModels(objConnection, objSecurity);
        m_objHoaDonModels = new HoaDonModels(objConnection, objSecurity);
        m_objDichVuModels = new DichVuModels(objConnection, objSecurity);
        m_objBaoHiemModels = new BaoHiemModels(objConnection, objSecurity);
        m_objKhoaModels = new KhoaModels(objConnection, objSecurity);
        m_objPhongKhamModels = new PhongKhamModels(objConnection, objSecurity);
        m_objBenhNhanModels = new BenhNhanModels(objConnection, objSecurity);
        m_objDonThuocModels = new DonThuocModels(objConnection, objSecurity);
        m_objHoSoBAModels = new HoSoBAModels(objConnection, objSecurity);
        m_LuongModels = new LuongModels(objConnection, objSecurity);
        m_NhanVienModels = new NhanVienModels(objConnection, objSecurity);
        m_objThuocModels = new ThuocModels(objConnection, objSecurity);
    }

	public abstract ResultSet ExecOfGetElements() throws Exception;

    public abstract ResultSet ExecOfGetElementById(T obj) throws Exception;

    public abstract void ExecOfCheckElement(T obj) throws Exception;

    public abstract boolean ExecOfInsertElement(T obj) throws Exception;

    public abstract boolean ExecOfUpdateElement(T obj) throws Exception;

    public abstract boolean ExecOfDeleteElement(T obj) throws Exception;

    public abstract ResultSet ExecOfFindElement() throws Exception;
}
